﻿package mortal.game.view.copy.worldBoss.other
{
    import __AS3__.vec.*;
    import com.mui.controls.*;
    import extend.language.*;
    import flash.events.*;
    import mortal.common.global.*;
    import mortal.component.window.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.item.*;
    import mortal.mvc.interfaces.*;

    public class WorldBossLastHitPanel extends SmallWindow
    {
        private var rewardItems:Vector.<BaseItem>;
        private static var _instance:WorldBossLastHitPanel;

        public function WorldBossLastHitPanel(param1:ILayer = null)
        {
            this.rewardItems = new Vector.<BaseItem>;
            super(param1);
            setSize(260, 175);
            title = Language.getString(21426);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            pushUIToDisposeVec(UIFactory.gTextField(Language.getString(21427), 30, 45, 200, 40, this, GlobalStyle.textFormatHuang2.setSize(13)));
            var _loc_1:* = UIFactory.gButton(Language.getString(21428), 110, 140, 50, 22, this);
            _loc_1.configEventListener(MouseEvent.CLICK, this.onClickClose);
            pushUIToDisposeVec(_loc_1);
            return;
        }// end function

        public function onClickClose(event:MouseEvent) : void
        {
            this.hide();
            return;
        }// end function

        public function addRewardItem(param1:ItemData, param2:int) : void
        {
            var _loc_3:* = UIFactory.getUICompoment(BaseItem, 30 + 45 * this.rewardItems.length, 78, this);
            _loc_3.setItemStyle(ItemStyleConst.Small, ImagesConst.PackItemBg, 2, 2);
            _loc_3.isShowLock = true;
            _loc_3.itemData = param1;
            _loc_3.amount = param2;
            this.rewardItems.push(_loc_3);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            var _loc_2:int = 0;
            while (_loc_2 < this.rewardItems.length)
            {
                
                this.rewardItems[_loc_2].dispose();
                _loc_2++;
            }
            this.rewardItems.length = 0;
            super.disposeImpl(param1);
            return;
        }// end function

        public static function get instance() : WorldBossLastHitPanel
        {
            if (!_instance)
            {
                _instance = new WorldBossLastHitPanel;
            }
            return _instance;
        }// end function

    }
}
